home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copyright © 1992-1993 Mark Pilgrim *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define VBarGap 5
- #define HBarGap (VBarGap*MAIN_WINDOW_HEIGHT/MAIN_WINDOW_WIDTH)
- #define CorrectTime 1
-
- void FourCorner(GrafPtr);
-
- /* Take 4 bars, two on each axis, and move them towards different corners.
- This means lots of overlap copying, but the timing masks it and Quickdraw
- may even take care of some of it. (?) */
-
- void FourCorner(GrafPtr sourceGrafPtr)
- {
- Rect vsource1,hsource1,vsource2,hsource2;
- int vbar,hbar,cx,cy;
-
- vbar=VBarGap;
- hbar=HBarGap;
- cx = MAIN_WINDOW_WIDTH/2;
- cy = MAIN_WINDOW_HEIGHT/2;
- vsource1.top=vsource2.top=hsource2.left=hsource1.left=0; /* these */
- vsource1.bottom=vsource2.bottom=MAIN_WINDOW_HEIGHT; /* never */
- hsource1.right=hsource2.right=MAIN_WINDOW_WIDTH; /* change */
- while (vbar<cx+VBarGap)
- {
- StartTiming();
- vsource1.left=cx-vbar;
- vsource1.right=vsource1.left+VBarGap;
- vsource2.right=cx+vbar;
- vsource2.left=vsource2.right-VBarGap;
- hsource1.top=cy-hbar;
- hsource1.bottom=hsource1.top+HBarGap;
- hsource2.bottom=cy+hbar;
- hsource2.top=hsource2.bottom-HBarGap;
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &vsource1, &vsource1, 0, 0L);
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &hsource1, &hsource1, 0, 0L);
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &vsource2, &vsource2, 0, 0L);
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &hsource2, &hsource2, 0, 0L);
- vbar+=VBarGap;
- hbar+=HBarGap;
- TimeCorrection(CorrectTime);
- }
- }